<!--  -->
<template>
  <div>
    <p>模块二 2</p>
    <!-- <CommonMes  :MesStyle="MesStyle.success" @handelClick="handelClick"></CommonMes> -->

    <!-- 组件一 -->
    <m1 @addClick="addClick"></m1>
    <!-- 组件二 -->
    <m2 :newNum="newNum"></m2>
  </div>
</template>

<script lang="ts" setup>
import { ref } from "vue";
import CommonMes from "@/components/CommonMes";
import m2 from "./m2.vue";
import m1 from "./m1.vue";
const MesStyle = {
  success: {
    text: "成功",
    type: "success",
  },
  warn: {
    text: "warning",
    type: "warning",
  },
};

// 子组件相互传值
const newData = {
  newNum: {
    num: 1,
    type: "success",
  },
};
const addClick = (params) => {
  // console.log(params,'父组件');
  newData.newNum = params;
};
</script>
<style lang="scss" scoped></style>
